interface a1{
  name:string
  age:number
}
const objj11:a1[]=[
  {
    name:'张三',
    age:18
  },
  {
    name:'李四',
    age:20
  }
]

// 定义一个用迭代器遍历数据的函数,该函数的语法糖是for of
const each=(value:any):void=>{
  // 调用构造器
  let It:any=value[Symbol.iterator]()
  let next:any ={done:false}
  while(!next.done){
    next=It.next()
    if(!next.done){
      console.log(next.value)
      // console.log(next)
    }
  }
}
each(objj11)